package com.dp.appi.service.impl;

import com.dp.appi.dao.ExperienceDao;
import com.dp.appi.service.ExperienceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by xiaoji on 2016/5/3.
 * 经验
 */
@Service
public class ExperienceServiceImpl implements ExperienceService {
    @Autowired
    private ExperienceDao experienceDao;

    /**
     * 我的经验
     *
     * @param name 查询关键字
     * @param s    开始序列
     * @param n    获取条数
     * @param id   用户id
     * @return
     */
    @Override
    public List<Map<String, Object>> experienceList(String name, Integer s, Integer n, String id) {
        return experienceDao.experienceList(name,s,n,id);
    }

    /**
     * 删除我的经验
     *
     * @param experience_id 经验id
     * @param id            用户id
     */
    @Override
    public void delExp(Long experience_id, String id) {
        experienceDao.delExp(experience_id,id);
    }

    /**
     * 发布经验
     *
     * @param experience_id 经验id
     * @param id            用户id
     */
    @Override
    public void publishExp(Long experience_id, String id) {
        experienceDao.publishExp(experience_id,id);
    }

    /**
     * 获取经验内容
     *
     * @param experience_id 经验id
     */
    @Override
    public Map<String, Object> getExperienceContent(Long experience_id) {
        return experienceDao.getExperienceContent(experience_id);
    }
}
